#ifndef _Items_h_
#define _Items_h_
#include<d3d9.h>
#include<d3dx9.h>
#include"Sprite.h"
#include"Object.h"
#include"Star.h"
#include"Mushroom.h"
#include"Flower.h"
#include"Coin.h"
class NODE_ITEM
{
public: 
	int kind;
	CStar *star;
	CMushroom *mushroom;
	CFlower *flower;
	CCoin *coin;
	NODE_ITEM *next;
};
class LIST_ITEM
{
public:
	NODE_ITEM *pHead;
	NODE_ITEM *pTail;
};
void AddItem(LIST_ITEM &list,int kind,CStar *star,CMushroom *mushroom,CFlower *flower,CCoin *coin);
void RemoveHead(LIST_ITEM &list);
void RemoveTail(LIST_ITEM &list);
int RemoveNode(LIST_ITEM &list,NODE_ITEM *p);
class CItems
{
	int kind;
	int x;
	int y;
	CStar *star;
	CMushroom *mushroom;
	CFlower *flower;
	CCoin *coin;
	CSprite *minicoin;
public:
	LIST_ITEM list;
	CItems();
	~CItems();
	RECT getRect();
	void GetItems(Object object);
	void DeleteItems();
	void Move(CStaticObjects *StaticObjects,RECT screen);
	int CollisionWithMario(int *kind,RECT marioRect);
	void Render(LPD3DXSPRITE sprite,LPDIRECT3DTEXTURE9 image,int time,int xcamara);
	
};
#endif